<?php
function div_left_so_out($par) {
	$t=$par['t'];
	$bx=$par['bx'];
	$tv=$par['tv'];
	$newarr=$par['newarr'];
	$subkind=$par['subkind'];
	$ulcls=$par['ulcls'];
	$show=$par['show'];
	$tbody=(!empty($par['tbody']))?$par['tbody']:data_data_title($t);
	if(empty($show) || !empty($tv)){
		$ul_show_cls='';$show=' class="on"';
	}elseif($show=='off'){
		$ul_show_cls=' style="display:none;"';$show='';
	}
	global $_UDATA;
	$ARR = (is_array($newarr) && count($newarr)>0)?$newarr:json_decode($_UDATA[$t]);
	if(is_array($ARR) && count($ARR)>0){
		echo '<div class="tbox" id="t'.$t.'">';
		echo '<h5'.$show.'>'.$tbody.'</h5>';
		echo '<ul class="def'.$ulcls.'"'.$ul_show_cls.'>';
		$cls=(empty($tv))?' class="ed"':'';
		if($bx==0)echo '<li'.$cls.' v="0">不限</li>';
		$defv=explode(',',$tv);
		foreach ($ARR as $V){
			$cls='';
			if(count($defv)>1 && is_array($defv)){
				foreach ($defv as $V2) {if($V->i==$V2){$cls=' class="ed"';break;}}
			}else{
				$cls=($V->i==$tv)?' class="ed"':'';
			}
			echo '<li'.$cls.' v="'.$V->i.'">'.$V->v.'</li>';
		}
		echo '</ul></div>';
		echo '<input type="hidden" id="'.$t.'" name="'.$t.'" value="'.$tv.'">';
		if($subkind==3){
			echo '<script>reg_diy_checkbox("'.$t.'");</script>';
		}else{
			echo '<script>reg_diy_radio("'.$t.'");</script>';
		}
	}
}
function doinsql($F,$V) {
	if(!empty($V)){
		$Varr=explode(',',$V);
		if (count($Varr) >= 1 && is_array($Varr)){
			$newARR=array();
			foreach ($Varr as $v2) {if(ifint($v2))$newARR[]=$v2;}
			if(count($newARR)>0){
				$list = (is_array($newARR))?implode(',',$newARR):'';	
				$ZEAI_SQL = " AND $F IN ($list) ";
			}
		}
	}
	return $ZEAI_SQL;
}
?>